﻿using DoNet.Common.Enums;
using DoNet.Core;
using DoNet.System.Dtos;
using DoNet.System.Models;

namespace DoNet.System.IServices
{
    public interface ITaskManagerService : IService<TaskManager, TaskManagerOutputDto>
    {
        #region 同步方法
        /// <summary>
        /// 同步记录任务运行结果
        /// </summary>
        /// <param name="jobId">任务Id</param>
        /// <param name="jobAction">任务执行动作</param>
        /// <param name="blresultTag">任务执行结果表示，true成功，false失败，初始执行为true</param>
        /// <param name="resume">结果简述</param>
        /// <param name="desc">返回消息详情</param>
        void RecordRun(long jobId, JobAction jobAction, bool blresultTag = true, string resume = "", string desc = "");
        #endregion 同步方法

        #region 异步方法
        /// <summary>
        /// 异步记录任务运行结果
        /// </summary>
        /// <param name="jobId">任务Id</param>
        /// <param name="jobAction">任务执行动作</param>
        /// <param name="blresultTag">任务执行结果表示，true成功，false失败，初始执行为true</param>
        /// <param name="resume">结果简述</param>
        /// <param name="desc">返回消息详情</param>
        Task RecordRunAsync(long jobId, JobAction jobAction, bool blresultTag = true, string resume = "", string desc = "");
        #endregion 异步方法
    }
}
